
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>SpringAOP的通知类型有那些 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>SpringAOP的通知类型有那些 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">Spring AOP中定义了哪五种核心的通知（Advice）类型？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Spring AOP定义了五种通知类型：1. 前置通知 (Before Advice)；2. 后置通知 (After Returning Advice)；3. 异常通知 (After Throwing Advice)；4. 最终通知 (After Advice)；5. 环绕通知 (Around Advice)。</div>
          </div>
          <div class="card-source">来源: 文档开篇对五种通知类型的定义列表</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">“后置通知”(After Returning) 和 “最终通知”(After) 的主要区别是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">主要区别在于执行时机。“后置通知”仅在目标方法成功执行之后执行，可以获取返回值。而“最终通知”无论目标方法是否成功执行（即是否抛出异常），都会在方法执行后被调用。</div>
          </div>
          <div class="card-source">来源: 文档开篇对后置通知和最终通知的描述</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在Spring AOP中，哪种通知类型的功能最强大，为什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">环绕通知（Around Advice）功能最强大。因为它可以在目标方法执行前后都执行自定义逻辑，并且可以通过调用 `ProceedingJoinPoint.proceed()` 来完全控制目标方法的执行。</div>
          </div>
          <div class="card-source">来源: 文档开篇对环绕通知的描述及「Spring实现AOP」章节中的代码示例</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在一个传统的、基于XML配置的Spring项目中，如何启用AOP功能？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">通过在Spring配置文件中添加 `<aop:aspectj-autoproxy/>` 标签来启用AOP，并使用 `<bean>` 标签引入切面类。</div>
          </div>
          <div class="card-source">来源: 「Spring实现AOP」章节</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在Spring Boot项目中启用AOP功能，需要完成哪两个关键步骤？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">1. 在 `pom.xml` 中添加 `spring-boot-starter-aop` 依赖。 2. 在Spring Boot的启动类上添加 `@EnableAspectJAutoProxy` 注解。</div>
          </div>
          <div class="card-source">来源: 「集成SpringBoot后的实现」章节</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在环绕通知（@Around）的代码实现中，`ProceedingJoinPoint`参数有什么作用？如何通过它调用目标方法？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`ProceedingJoinPoint` 参数用于提供对目标方法的访问。通过调用其 `proceed()` 方法，可以执行原始的目标方法，从而实现在目标方法执行前后插入自定义逻辑。</div>
          </div>
          <div class="card-source">来源: 「Spring实现AOP」章节中@Around通知的代码示例</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
